package com.emm.yixun.openapi.hander;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.emm.yixun.common.app.ProjectsPmoReqDto;
import com.emm.yixun.common.app.ProjectsPmoResDto;
import com.emm.yixun.estate.service.app.ProjectInfoServiceAppFacade;
import com.emm.yixun.openapi.dto.base.BaseRequestDTO;
import com.emm.yixun.openapi.dto.base.BaseResponseDTO;
import com.emm.yixun.openapi.vo.ProjectsPmoReqVo;

/**
 * 项目创建与编辑接口（绿城扩展PMO）
 * 
 * @author Administrator
 *
 */
@Service("projectsPmoHander")
public class ProjectsPmoHander extends com.emm.yixun.openapi.hander.base.CommonAbstractHander{
	
	@Autowired
	private ProjectInfoServiceAppFacade projectInfoServiceAppFacade;
	
	@SuppressWarnings("rawtypes")
	@Override
	public BaseResponseDTO doBusiness(BaseRequestDTO reqDto) {
		ProjectsPmoReqVo req = (ProjectsPmoReqVo)reqDto;
		ProjectsPmoReqDto reqDto1 = req.getParams();
		reqDto1.setBodyJson(req.getBodyJson());
		reqDto1.setAdd(req.isAdd());
		BaseResponseDTO<ProjectsPmoResDto> res = new BaseResponseDTO<ProjectsPmoResDto>();
		try {
			res.setResData(projectInfoServiceAppFacade.projectsPmo(reqDto1));
		} catch (Exception e) {
			ProjectsPmoResDto projectsPmoResDto=new ProjectsPmoResDto();
			projectsPmoResDto.setCode("100005");
			projectsPmoResDto.setDesc("数据库操作异常");
			res.setResData(projectsPmoResDto);
		}
		return res;
	}
	
}
